import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Layout from './views/Layout.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      redirect: '/layout'
    },
    {
      path: '/login',
      name: '管理员登录',
      component: () => import('./views/Login.vue')
    },
    {
      path: '/layout',
      name: '框架',
      redirect: '/index',
      component: Layout,
      children: [
        {
          path: '/index',
          name: '平台概述',
          component: Home
        }, {
          path: '/goods-info',
          name: '商品信息',
          component: () => import('./views/GoodsInfo.vue')
        }, {
          path: '/goods-type',
          name: '商品分类',
          component: () => import('./views/GoodsType.vue')
        }, {
          path: '/user',
          name: '用户管理',
          component: () => import('./views/User.vue')
        }, {
          path: '/order',
          name: '订单管理',
          component: () => import('./views/Order.vue')
        }, {
          path: '/market-all',
          name: '全部推广员',
          component: () => import('./views/MarketAll.vue')
        }, {
          path: '/market-reply',
          name: '推广员申请',
          component: () => import('./views/MarketApply.vue')
        }, {
          path: '/market-level',
          name: '岗位设置',
          component: () => import('./views/MarketLevel.vue')
        }, {
          path: '/message',
          name: '消息管理',
          component: () => import('./views/Message.vue')
        }, {
          path: '/setting',
          name: '系统设置',
          component: () => import('./views/Setting.vue')
        }
      ]
    }
  ]
})
